<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>queryCommandEnabled bug</title>
	<script type="text/javascript">

window.onload = function()
{
	// Catch the keydown event (not related to the bug).
	if ( window.document.addEventListener )
		window.document.addEventListener( 'keydown', Document_OnKeyDown, false ) ;
	else
		window.document.attachEvent( 'onkeydown', Document_OnKeyDown ) ;

	// Enable editing when the page.
	if ( (/msie/).test( navigator.userAgent.toLowerCase() ) )
		document.body.contentEditable = true ;
	else
		document.designMode = 'on' ;
}

function Document_OnKeyDown( ev )
{
	var keyCode = ev.keyCode || ev.which ;

	if ( keyCode == 16 || keyCode == 32 )	// Safari doesn't catch "Shift".
	{
		alert( document.queryCommandEnabled( 'Bold' ) ) ;
		alert( document.queryCommandState( 'Bold' ) ) ;
	}
}

	</script>
</head>
<body>
	<p>
		<b>Select a word in this phrase and press the [Shift]* key. You should see two alerts,
			the first must say "true" and the second must say "true".<br /><span style="color: Red">Opera
				will fail in this case.</span></b>
	</p>
	<p>
		Select a word in this phrase and press the [Shift]* key. You should see two alerts,
		the first must say "true" and the second must say "false".
	</p>
	<p>
		* On Safari, hit the [Space] key instead.</p>
</body>
</html>
